module(..., package.seeall)


os.path = {}
os.path.sep = package.config:sub(1, 1)

function os.path.convert(path)
    return path:gsub("[\\/]", os.path.sep)
end

function os.path.join(...)
    local parts = {}
    for _, part in ipairs{...} do
        part = os.path.convert(part)
        if part:endswith(os.path.sep) then
            part = part:sub(1, -(#os.path.sep + 1))
        end
        parts[#parts+1] = part
    end
    return os.path.sep:join(parts)
end
